/**
 * Created with IntelliJ IDEA.
 * Description: Java程序设计面向对象（下）实验代码题目三
 */
interface Shape {
    double area(double x) ;
}

class Square implements Shape {

    @Override
    public double area(double x) {
        return x * x;
    }
}

class Cirle implements Shape {

    @Override
    public double area(double x) {
        return 3.1415926 * (x * x);
    }
}

public class Example03 {
    public static void main(String[] args) {
        Square square = new Square();
        Cirle circle = new Cirle();
        System.out.println(square.area(2.0));
        System.out.println(circle.area(3.0));
    }
}
